<!DOCTYPE html>
<html>
    <head>
        <meta charset="ISO-8859-1">
        <title>JavaScript Window History</title>
    </head>
    <body>
        The window.history object contains the browsers history.
        <h2>Window History</h2>
        <p>The <strong>window.history</strong> object can be written without the window prefix.</p>
        To protect the privacy of the users, there are limitations to how JavaScript can access this object.
        Some methods:
        <ul>
            <li>history.back() - same as clicking back in the browser</li>
            <li>history.forward() - same as clicking forward in the browser</li>
        </ul>
        <h2>Window History</h2>
        The history.back() method loads the previous URL in the history list.
        This is the same as clicking the Back button in the browser.
        <script>
            function goBack() {
                history.back();
            }
            
            function goForward() {
                window.history.forward();
            }
        </script>
        <input type="button" value="back" onclick="goBack()">
        <br>
        The history forward() method loads the next URL in the history list.
        This is the same as clicking the Forward button in the browser.
        <br>
        <input type="button" value="Forward" onclick="goForward()">
        
    </body>
</html>